# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=evolution-ews
pkgver=3.44.3
pkgrel=0
pkgdesc="MS Exchange integration through Exchange Web Services"
url="https://wiki.gnome.org/Apps/Evolution/EWS"
arch="all !s390x !riscv64" # blocked by evolution
license="LGPL-2.1-or-later"
makedepends="cmake gtk-doc intltool glib-dev gettext-dev evolution-data-server-dev
	evolution-dev libmspack-dev uhttpmock-dev samurai"
options="!check" # fail in docker due to port restrictions
subpackages="$pkgname-lang"
source="https://download.gnome.org/sources/evolution-ews/${pkgver%.*}/evolution-ews-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DENABLE_TESTS=TRUE
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
b0961b209107c2df396ff5e2dcb8e9229184a6efd6fe9412cf066470d2c73844209cf2d5e4a7e4dcebb0da5bc2119fbe5d1008b5ec58592cf307178dc680d515  evolution-ews-3.44.3.tar.xz
"
